import '../mixins/user_mixin.dart';

class QirdUser with UserMixin {
  QirdUser({
    required String id,
    required String name,
    required String email,
  }) {
    this.id = id;
    this.name = name;
    this.email = email;
    validateEmail(email);
  }

  factory QirdUser.fromJson(Map<String, dynamic> json) {
    if (json['id'] == null || json['name'] == null || json['email'] == null) {
      throw ArgumentError('Missing required fields');
    }
    return QirdUser(
      id: json['id'],
      name: json['name'],
      email: json['email'],
    );
  }
}
